package com.wxy.feiteng.blog02.service.impl;

import com.wxy.feiteng.blog02.dao.Userrespsitory;
import com.wxy.feiteng.blog02.entity.People;
import com.wxy.feiteng.blog02.service.PeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PeopleServiceImpl implements PeopleService {
//    注入持久层的对象:
    @Autowired
    public Userrespsitory userrespsitory;
    @Override
    public List<People> findAll() {
        List<People> all = userrespsitory.findAll();
        return all;

    }

    @Override
    public People findByUsernameAndPassword(String username, String password) {

        People byUsernameAndPassword = userrespsitory.findByUsernameAndPassword(username, password);
        return byUsernameAndPassword;
    }
}
